
<style>
#ulleft{ width: 100%; margin: 0; padding: 5px; border: 1px solid #CCC; 
         -moz-box-shadow:3px 3px 3px rgba(204,204,204, 0.4) inset,
	                -3px -3px 3px rgba(204,204,204, 0.4) inset;           
	-webkit-box-shadow:3px 3px 3px rgba(204,204,204, 0.4) inset,
		               -3px -3px 3px rgba(204,204,204, 0.4) inset;       
	box-shadow:3px 3px 3px rgba(204,204,204,, 0.4) inset,           
		       -3px -3px 3px rgba(204,204,204, 0.4) inset;
}
#ulleft li{
	list-style: none;
	border-bottom: 1px solid #CCC;
	}
.linor{ width: 100%; height: 50px; margin:0;; padding: 10; border-bottom: 1px solid #CCC; line-height: 50px; text-align: center;}

.linor:hover{ background-color: #CCC;}

<!--修改密码框-->
#xiugaicode{
	background-color: #FFF;
	width: 600px;
	margin: 100px auto;
	padding-top: 20px;
	padding-bottom: 30px;
	padding-left: 50px;
	}
#xiugaititle{
	margin: 0;
	padding: 0;
	}
#xiugaititle img{
	width: 50px;
	height: 50px;
	vertical-align: middle;
	}
#xiugaititle span{
    display: block;
	}
#xiugaidiv2{
	width: 500px;
	margin: 0 auto;	
	overflow: hidden
	}
#formxiugai dt{
	float: left;
	margin:10px;
	width: 110px;
	vertical-align: middle;
	display: inline-block;
	height: 25px;
	 text-align:justify;
     text-align-last:justify;
}
#formxiugai dt:after{
     display:inline-block;
     overflow:hidden;
     width:100%;
     height:0;
     content:'';
     vertical-align: middle;
}
#formxiugai dd{
	float: left;
	margin:10px;
	width: 340px;
	height: 25px;
	}
#formxiugai p{
	margin: 0;
	padding: 0;
	text-align: left;
	}
#formxiugai input{
     width: 180px;
	}


.error{
	color:red;
}

#xgcode{
	width: 0px;
	height: 0px;
	overflow: hidden;
	position: relative;
	top: -200px;
	left: 300px;
	zoom: 1;
	z-index: 10;
	-webkit-transition: all .3s;
	-moz-transition: all .3s;
	-ms-transition: all .3s;
	-o-transition: all .3s;
	margin: 0;
	padding: 0;
	background-color: #FFF;
	border: 0px solid #CCC;
	box-shadow:3px 3px 3px #CCC;
	  _webkit-box-shadow:3px 3px 3px #CCC;
	  _moz-box-shadow:3px 3px 3px #CCC;
	}


#tjmanage{
	width: 0;
	height: 0;
	overflow: hidden;
	position: relative;
	top: -150px;
	left: 200px;
	zoom: 1;
	z-index: 10;
	-webkit-transition: all .3s;
	-moz-transition: all .3s;
	-ms-transition: all .3s;
	-o-transition: all .3s;
	margin: 0;
	padding: 0;
	background-color: #FFF;
	border: 0px solid #CCC;
	box-shadow:3px 3px 3px #CCC;
	  _webkit-box-shadow:3px 3px 3px #CCC;
	  _moz-box-shadow:3px 3px 3px #CCC;
	}


</style>

 <script src="//apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="../js/validate-1.14.0.min.js"></script>
<script>
$().ready(function() {

$(function(){
  $('#formxiugai').validate({
		rules:{
			pw01gai:{
				required:true,
				rangelength:[6,12]
			},
			pw02gai:{
				required:true,
				equalTo:'#pw01gai'
			}	
		
		},
		messages:{
			pw01gai:{
				required:'请设置一个密码',
				rangelength:'密码位数为6到12位'
			},
			pw02gai:{
				required:'请再次确认密码',
				equalTo:'两次输入密码不相符'
			}
						
		}
	});	
  });
  
 //点击出现悬浮框 
 $('#xg').click(function(){
	 
	 $('#xgcode').css(
	                 {'width': '600px',
	                  'height': '280px',
					  'border': '1px solid #CCC', });
	 
	 }); 
	 
  $('#glry').click(function(){
	 
	 $('#tjmanage').css(
	                 {'width': '800px',
	                  'height': 'auto',
					  'border': '1px solid #CCC', });
	 
	 });
	 
 //点击关闭悬浮框 
 $("#closexg").click(function(){ 
	 
	 $("#xgcode").css(
	                 {'width': '0',
	                  'height': '0', });  //没有用
	 
	 });	 
	
   $("#closemanage").click(function(){ 
	 
	 $("#tjmanage").css(
	                 {'width': '0',
	                  'height': '0', });  //没有用
	 
	 }); 
	 
 //密码修改
 $("#delm").click(function(){

      var str3 = $("#pw01gai").val();
	  var str4 = $("#pw02gai").val();
	 var str2 = document.getElementById("adminname").innerHTML; //alert(1);
	 var str = str3 + "-" + str2;  //alert(str);
if(str3 == str4){	//validate只能阻止表单提交，不能阻止click，加此判断避免错误提交 
    if (window.XMLHttpRequest)
    {
        // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
        xmlhttp=new XMLHttpRequest();
    }
    else
    {
        // IE6, IE5 浏览器执行代码
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    { //alert(1);
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        { //alert(2);
            document.getElementById("xgres").innerHTML=xmlhttp.responseText; //alert(3);
        }
    }
    xmlhttp.open("GET","resetm.php?q="+str,true);
    xmlhttp.send();

}
 })
  

 //删除管理员
 $("#xiugai").click(function(){

      var str3 = $("#pw01gai").val();
	  var str4 = $("#pw02gai").val();
	 var str2 = document.getElementById("adminname").innerHTML; //alert(1);
	 var str = str3 + "-" + str2;  //alert(str);
if(str3 == str4){	//validate只能阻止表单提交，不能阻止click，加此判断避免错误提交 
    if (window.XMLHttpRequest)
    {
        // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
        xmlhttp=new XMLHttpRequest();
    }
    else
    {
        // IE6, IE5 浏览器执行代码
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    { //alert(1);
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        { //alert(2);
            document.getElementById("xgres").innerHTML=xmlhttp.responseText; //alert(3);
        }
    }
    xmlhttp.open("GET","resetm.php?q="+str,true);
    xmlhttp.send();

}
 })
















  
  
});


</script>




<div style=" width: 140px; margin: 0; padding: 0;">
    <ul id="ulleft">
        <li style=" width: 100%; height: 80px; line-height: 80px; text-align: center; margin: 0; padding: 10; "><strong>后台管理导航</strong></li>
        <li class="linor" >商&nbsp;品&nbsp;分&nbsp;类</li>
        <li class="linor">添&nbsp;加&nbsp;商&nbsp;品</li>
        <li class="linor" id="glry">管&nbsp;理&nbsp;人&nbsp;员
        
        
            <div id="tjmanage"><div style=" margin:o; padding: o; height: 20px;"><p style=" text-align: right; padding-right:30px;"><a href=""><span id="closemanage"><strong>关闭</strong></span></a></p></div><div>
            
                <div id="managelist" style="float: left; margin: 20px;">
                    <p><strong>管理人员账户清单</strong></p>
                    <table>
                        <tr>
                            <th>编号</th><th>用户名</th><th>权限</th><th>操作</th>
                        </tr>
                        <?php 
						    $res = $bb->findallmanage(); //var_dump($res);
							while($row= mysqli_fetch_array($res, MYSQLI_ASSOC) ){
						?>
                        <tr>
                            <td><?php echo $row['id']; ?></td><td><?php echo $row['user_name']; ?></td>
                            <td><?php echo $row['right_control']; ?></td><td><button id="delm">删除</button></td>
                        </tr>
                        <?php } ?>
                      </table>
                </div>
        
                <div id="newmanage" style="float: right; margin: 20px;">
                    <form id="addnew">
                        <p>用户名：<input type="text" name="newmname" id="newmname" placeholder="请输入新管理名称"></p>
                        <p>密　码：<input type="password" name="newmpw1" id="newmpw1" placeholder="请设置密码"></p>
                        <p>密　码：<input type="password" name="newmpw2" id="newmpw2" placeholder="请重复密码"></p>
                        <p>权　限：<input type="text" name="newmright" id="newmright" placeholder="请设置新管理权限"></p>
                    </form>
                    <div><button id="addnewm">添加新管理</button></div>
                </div>
        
        
        
            </div></div>
        
        </li>
        
        
        
        
        
        
        
        
        
        
        
        
        
        <li class="linor" id="xg">修&nbsp;改&nbsp;密&nbsp;码
        
        <!--修改密码-->
<div id="xgcode">

     <div id="xiugaicode">
         <div style=" margin: 0 auto; width: 200px;"><p id="xiugaititle"><span><img src="../img/head-logo.jpg" />　<strong>修改密码</strong></span></p></div>
        <div id="xiugaidiv2">
          <form id="formxiugai" > 
            <dl>
                
                <dt>密码</dt><dd><p><input id="pw01gai" name="pw01gai" type="password" placeholder="请输入密码"><span class="error">*</span></p></dd>
                <dt>重复密码</dt><dd><p><input id="pw02gai" name="pw02gai" type="password" placeholder="请再次输入密码"><span class="error">*</span></p></dd>
                                        
            </dl>
             </form>
             <div style=" margin: 0 auto; width: 250px;"><p style='font-size:20px'><button id="xiugai" ><span><strong>修改密码</strong></span></button>　　<button id="closexg"><a href=""><span ><strong>关　闭</strong></span></a></button></p></div>
            
         
           <div><p style=" text-align: center; color: red;" id="xgres">
		 
		   </p></div>
        </div>
      </div>
        
</div>
        
        </li>
        <li style=" width: 93%; height: 80px; text-align: left; margin: 0; padding-left: 10px;  font-size: 10px;">
        <br>版&nbsp;本&nbsp;号： verson 1.0<br>
            版权所有： <a href="../shoppingmall.php" target="_blank">small T</a> <br>
            设计制作： <a href="" target="_blank">jip</a> <br>
            技术支持： <a href="" target="_blank">jip</a></li>
        <div style=" width: 100%; height: 50px;"></div>
    </ul>
</div>


